package me.liuyu2783.dubbo.sample;

import me.liuyu2783.dubbo.sample.api.HelloService;
import me.liuyu2783.dubbo.sample.dubbo.ProxyFactory;

/**
 * me.liuyu2783.dubbo.sample.dubbo
 *
 * @author liuyu2783
 * @date 2020-3-3
 */
public class Consumer {

    public static void main(String[] args) {

//        Invocation invocation = new Invocation();
//        invocation.setInterfaceName("me.liuyu2783.dubbo.sample.api.HelloService");
//        invocation.setMethodName("hello");
//        invocation.setParamType(new Class[]{String.class});
//        invocation.setParams(new String[]{"liuyu2783"});
//
//        String result = new HttpClient().send("localhost",8888, invocation);
//        System.out.println("应答结果："+result);

        HelloService helloService = ProxyFactory.getProxy(HelloService.class);;
        String result = helloService.hello("liuyu2783");
        System.out.println("应答结果："+result);
    }
}
